home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Over 1,000 Windows 95 Programs
/
Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso
/
1256
/
tour000.co_
/
tour000.co
Wrap
Text File
|
1997-04-18
|
11KB
|
259 lines
*---Created with EasyCODE(COB)----------------------------------- # EASY O
*---Last modification: 01.03.1995 14:22:33----------------------- # EASY K
*This program executes the events "Start" and "Shut" and carries \
*out file accesses.
*---------------------------------------------------------------- # EASY *
*---------------------------------------------------------------- # EASY (
*TOUR000
*---------------------------------------------------------------- # EASY *
IDENTIFICATION DIVISION.
*---------------------------------------------------------------- # EASY (
**** Identification Division ***
*---------------------------------------------------------------- # EASY *
*
PROGRAM-ID. TOUR000.
*
* THIS PROGRAM PROCESSES THE EVENTS
* "START" AND "SHUT" OF AN APPLICATION
* AND HANDLES ALL FILE ACCESSES.
*
*---------------------------------------------------------------- # EASY )
ENVIRONMENT DIVISION.
*---------------------------------------------------------------- # EASY (
**** Environment Division ***
*---------------------------------------------------------------- # EASY *
*---------------------------------------------------------------- # EASY (
**** INPUT-OUTPUT Section ***
*---------------------------------------------------------------- # EASY *
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT JOURNEYS ASSIGN TO DA-590-I-SYS244
ORGANIZATION IS INDEXED ACCESS IS DYNAMIC
RECORD KEY IS JOURNEY-ID OF JOURNEY-RECORD.
SELECT BOOKINGS ASSIGN TO DA-590-I-SYS244
ORGANIZATION IS INDEXED ACCESS IS DYNAMIC
RECORD KEY IS JOURNEY-ID OF BOOKING-RECORD.
* # EASY S
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY )
DATA DIVISION.
*---------------------------------------------------------------- # EASY (
**** Data Division ***
*---------------------------------------------------------------- # EASY *
*---------------------------------------------------------------- # EASY (
**** FILE Section ***
*---------------------------------------------------------------- # EASY *
FILE SECTION.
FD JOURNEYS LABEL RECORDS STANDARD.
01 JOURNEY-RECORD.
COPY JOURNEY.
* # EASY -
FD BOOKINGS LABEL RECORDS STANDARD.
01 BOOKING-RECORD.
COPY BOOKING.
* # EASY S
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** WORKING-STORAGE Section ***
*---------------------------------------------------------------- # EASY *
WORKING-STORAGE SECTION.
77 STARTUP PIC X(8) VALUE "STARTUP".
77 SHUTDOWN PIC X(8) VALUE "SHUTDOWN".
* # EASY S
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** LINKAGE Section ***
*---------------------------------------------------------------- # EASY *
LINKAGE SECTION.
COPY KCKBC SUPPRESS.
05 DUMMY PIC X.
01 JOURNEY.
COPY JOURNEY.
01 BOOKING.
COPY BOOKING.
01 ERROR-SIGN PIC 9.
01 EOF PIC 9.
* # EASY S
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY )
PROCEDURE DIVISION USING KCKBC.
*---------------------------------------------------------------- # EASY (
**** Procedure Division ***
*---------------------------------------------------------------- # EASY *
*---------------------------------------------------------------- # EASY (
**** MAIN ***
*---------------------------------------------------------------- # EASY *
MAIN.
IF KCTACVG = STARTUP
THEN
PERFORM OPEN-FILES
ELSE
IF KCTACVG = SHUTDOWN
THEN
PERFORM CLOSE-FILES
END-IF
END-IF
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** OPEN-FILES ***
*---------------------------------------------------------------- # EASY *
OPEN-FILES.
OPEN I-O JOURNEYS
* # EASY -
OPEN I-O BOOKINGS
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** CLOSE-FILES ***
*---------------------------------------------------------------- # EASY *
CLOSE-FILES.
CLOSE JOURNEYS
* # EASY -
CLOSE BOOKINGS
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** WRITE-JOURNEY ***
*---------------------------------------------------------------- # EASY *
WRITE-JOURNEY.
ENTRY "WRJRNEY" USING JOURNEY, ERROR-SIGN.
MOVE 0 TO ERROR-SIGN
WRITE JOURNEY-RECORD FROM JOURNEY
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-WRITE
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** READ-JOURNEY-INDEXED ***
*---------------------------------------------------------------- # EASY *
READ-JOURNEY-INDEXED.
ENTRY "RDJRNEY" USING JOURNEY, ERROR-SIGN.
MOVE JOURNEY-ID OF JOURNEY TO JOURNEY-ID OF JOURNEY-RECORD
* # EASY -
MOVE 0 TO ERROR-SIGN
READ JOURNEYS INTO JOURNEY
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-READ
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** READ-JOURNEY-SEQU ***
*---------------------------------------------------------------- # EASY *
READ-JOURNEY-SEQU.
ENTRY "NXTJRNEY" USING JOURNEY, EOF.
MOVE 0 TO EOF
READ JOURNEYS NEXT INTO JOURNEY
AT END
MOVE 1 TO EOF
END-READ
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** POSITION-JOURNEY ***
*---------------------------------------------------------------- # EASY *
POSITION-JOURNEY.
ENTRY "POSJRNEY" USING JOURNEY, ERROR-SIGN.
MOVE JOURNEY-ID OF JOURNEY TO JOURNEY-ID OF JOURNEY-RECORD
* # EASY -
MOVE 0 TO ERROR-SIGN
START JOURNEYS KEY NOT < JOURNEY-ID OF JOURNEY-RECORD
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-START
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** REPLACE-JOURNEY ***
*---------------------------------------------------------------- # EASY *
REPLACE-JOURNEY.
ENTRY "RWRJRNEY" USING JOURNEY, ERROR-SIGN.
MOVE 0 TO ERROR-SIGN
REWRITE JOURNEY-RECORD FROM JOURNEY
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-REWRITE
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** DELETE-JOURNEY ***
*---------------------------------------------------------------- # EASY *
DELETE-JOURNEY.
ENTRY "DELJRNEY" USING JOURNEY, ERROR-SIGN.
MOVE JOURNEY-ID OF JOURNEY TO JOURNEY-ID OF JOURNEY-RECORD
* # EASY -
MOVE 0 TO ERROR-SIGN
DELETE JOURNEYS
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-DELETE
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** WRITE-BOOKING ***
*---------------------------------------------------------------- # EASY *
WRITE-BOOKING.
ENTRY "WRBOOKNG" USING BOOKING, ERROR-SIGN.
MOVE 0 TO ERROR-SIGN
WRITE BOOKING-RECORD FROM BOOKING
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-WRITE
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** READ-BOOKING-INDEXED ***
*---------------------------------------------------------------- # EASY *
READ-BOOKING-INDEXED.
ENTRY "RDBOOKNG" USING BOOKING, ERROR-SIGN.
MOVE JOURNEY-ID OF BOOKING TO
JOURNEY-ID OF BOOKING-RECORD
* # EASY -
MOVE 0 TO ERROR-SIGN
READ BOOKINGS INTO BOOKING
INVALID KEY
MOVE 1 TO ERROR-SIGN
END-READ
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY (
**** READ-BOOKING-SEQU ***
*---------------------------------------------------------------- # EASY *
READ-BOOKING-SEQU.
ENTRY "NXTBOOKNG" USING BOOKING, EOF.
MOVE 0 TO EOF
READ BOOKINGS NEXT INTO BOOKING
AT END
MOVE 1 TO EOF
END-READ
EXIT PROGRAM
.
* # EASY P
*---------------------------------------------------------------- # EASY )
*---------------------------------------------------------------- # EASY )
END PROGRAM TOUR000.
*---------------------------------------------------------------- # EASY )